package edu.zut.main.thread;

public class ThreadPriority {
    public static void main(String[] args) {

        Thread thread = new Thread(() -> {
            System.out.println(Thread.currentThread().getName() + " running...");
        }, "thread-A");

        Thread thread2 = new Thread(() -> {
            System.out.println(Thread.currentThread().getName() + " running...");
        }, "thread-B");
        //线程优先级  默认5  1-10
        thread.setPriority(8);
        thread2.setPriority(1);

        thread.start();
        thread2.start();
    }
}
